<?php
require("util.php");
require('../action/db.php');

if ($_GET['type'] == 'main_change')
{
    $brand_list           = get_brand_list($db,$_GET['class']);
    $brand_sub_list 	= get_sub_brand_list($db,$_GET['class'],$brand_list[0]);
    echo json_encode(array("brand_list"=>$brand_list,"brand_sub_list"=>$brand_sub_list));
}else if ($_GET['type'] = 'brand_change'){  
    $brand_sub_list	 = get_sub_brand_list($db,$_GET['class'],$_GET['brand']);
    echo json_encode(array("brand_sub_list"=>$brand_sub_list));
   
}
?>
